package com.roy.ai.service;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

/**
 * @author 山顶洞人郑某
 * @className Assistant.java AI 助手接口
 * @date 2025 04 01
 */
public interface Assistant{
    String chat(String userMessage);

    /**
     * 支持为每个用户都需要自己的实例来维护他们的个人对话
     * @param id 用于标识不同的用户的聊天窗口
     * @param userMessage 用户信息
     * @return
     */
    String chat(@MemoryId String id, String userMessage);
    /**
     * 分类
     * @param userMessage
     * @return
     */
    String category(String userMessage);
    //有效的 AI Service 方法示例
/*    String chat(@UserMessage String userMessage);

    String chat(@UserMessage String userMessage, @V("country") String country); // userMessage contains "{{country}}" template variable

    @UserMessage("What is the capital of Germany?")
    String chat();

    @UserMessage("What is the capital of {{it}}?")
    String chat(String country);

    @UserMessage("What is the capital of {{country}}?")
    String chat(@V("country") String country);

    @UserMessage("What is the {{something}} of {{country}}?")
    String chat(@V("something") String something, @V("country") String country);

    @UserMessage("What is the capital of {{country}}?")
    String chat(String country); // this works only in Quarkus and Spring Boot applications*/
    
    @Data
    @AllArgsConstructor
    public class User{
        private String name;
        private String sex;
    }
}
